
public class Code083 {
	public static void main(String[]args){
		for (int i = 1990; i < 2018; i++) {
			System.out.print(i+"\n");
		
		for (int j = 1; j < 13; j++) {
			if(j==12){
				System.out.print(j+"\n");
			}else{
			System.out.print(j+" ");
			}
			for (int k = 1; k < 32; k++) {
				if(j==1&&j==3&&j==5&&j==7&&j==8&&j==10&&j==12){
					if(j==31){
					System.out.print(k+"\n");
				}else{
				System.out.print(k+" ");
				}
				}
			}
			}
		}
		}
	}

